<?php
/**
 * 商城文章列表
 * 通用模块
 */
if (!defined('IN_CRONLITE')) die();
$notice_user = notice::user_notice(); #取出通知列表
if (!empty($_QET['id'])) {
    $state = 1;
    $data = $DB->get_row("SELECT * FROM `sky_notice` WHERE `id`='{$_QET['id']}' ");
    $data['content'] = htmlspecialchars_decode(base64_decode($data['content']));
}

?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title><?= '文章列表 - ' . $conf['sitename'].($conf['title']==''?'':' - '.$conf['title'])  ?></title>
    <meta name="keywords" content="<?= $conf['keywords'] ?>">
    <meta name="description" content="<?= $conf['description'] ?>">
    <!-- Vendor styles -->
    <link rel="icon" href="<?php echo $cdnserver; ?>assets/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" type="text/css" href="<?php echo $cdnserver; ?>assets/layui/css/layui.css"/>
</head>
<style>
    .navs {
        color: #fff;
        border: none;
        background-size: 1915%;
        animation: gradientBackground 20s alternate ease-out;
        animation-iteration-count: infinite;
        color: white !important;
        box-shadow: 1px 0px 16px #ccc;
    }

    @keyframes gradientBackground {
        0% {
            background-position: 0 0
        }
        50% {
            background-position: 50% 100%
        }
        100% {
            background-position: 100% 0
        }
    }

    .layui-shadow {
        margin: 1em auto;
        box-shadow: 0px 0px 4px #eee;
        transition: all 0.3;
        cursor: pointer;
        text-decoration: none;
        display: block;
    }

    .layui-shadow:hover {
        box-shadow: 0px 0px 16px #eee;
        background-color: #eee;
    }

    .layui-over {
        min-height: 38em;
        overflow: hidden;
        overflow-y: auto
    }

    .images {
        width: 110%;
        height: 110%;
        background-size: 100% 100%;
        z-index: -100;
        position: fixed;
        left: -5%;
        top: -5%;
        <?= background::image() == false ? 'background:linear-gradient(to left, #70e1f5, #ffd194);' : background::image() ?>
    }
    .imagtes img{
        max-width: 100%;
        display: block;
        margin:auto;
    }

</style
<body>
<div class="images"></div>
<div class="layui-fluid" style="opacity:0.98">
    <div class="layui-row">
        <div class="layui-col-md8 layui-col-sm-offset2" style="padding: 0.2em;color: #111;margin-top: 2em">
            <div class="layui-card">
                <div class="layui-card-header navs"
                     style="font-size: 1.5rem;text-align: center;height: 3rem;line-height: 3rem;background-color: darkviolet;color: white">
                    <a class="layui-icon layui-icon-left" style="position: absolute;left: 1em;color: white" href="./"> 返回</a>
                    平台资讯
                </div>
                <div class="layui-card-body" style="text-align: center">
                    <p style="margin: 1em auto">
                        <img src="http://q4.qlogo.cn/headimg_dl?dst_uin=<?= $conf['kfqq'] ?>&spec=100"
                             style="width: 6em;height: 6em;border-radius: 30em;box-shadow: 3px 3px 8px #ccc"/>
                    </p>
                    <div class="layui-card layui-text" style="text-align: end">
                        <div class="layui-card-body">
                            <?= $conf['notice_top'] ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <?php if (!empty($state)) { ?>
            <div class="layui-col-md6 layui-col-sm-offset2 " style="padding: 0.2em;color: #111;">
                <div class="layui-card">
                    <div class="layui-card-header" style="height: auto;font-weight: 800;font-size: 1.2em">
                        <?= $data['title'] ?>
                    </div>
                    <div class="layui-card-body imagtes">
                        <?= $data['content'] ?>
                        <center style="margin:6em auto 1em;color: #666">发布时间：<?= $data['date'] ?><br>
                            <a href="?mod=article" class="layui-icon layui-icon-home"
                               style="margin-top: 1em;display: block;width: 3em;height: 3em;"></a>
                        </center>
                    </div>
                </div>
            </div>
        <?php } ?>
        <div class="<?= $state == 1 ? 'layui-col-md2 layui-hide-xs' : 'layui-col-md8 layui-col-sm-offset2' ?>"
             style="padding: 0.2em;color: #111">
            <div class="layui-card">
                <div class="layui-card-header">文章列表 - 共<?= count($notice_user['data']) ?>篇文章</div>
                <div class="layui-card-body">
                    <div class="layui-card">
                        <div class="layui-card-body" style="padding: 0">
                            <div class="layui-card layui-text <? echo $state == 1 ? 'layui-over' : '' ?>">
                                <?php foreach ($notice_user['data'] as $v) { ?>
                                    <a href="?mod=article&id=<?= $v['id'] ?>"
                                       class="layui-card-header layui-elip layui-shadow"
                                       style="height: auto;color: #000000">
                                        <?= $v['title'] ?>
                                        <div class="layui-word-aux" style="float: right"><?= $v['date'] ?></div>
                                    </a>
                                <?php } ?>
                            </div>
                        </div>
                    </div>
                    <div class="layui-card-body layui-text" style="text-align: center">
                        <p>© <?= $conf['sitename'] ?>. All rights reserved.</p>
                        <?= $conf['notice_bottom'] ?>
                        <p><?= $conf['statistics'] ?></p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="<?php echo $cdnserver; ?>assets/layui/layui.all.js"></script>
<script>
    layui.use('util', function () {
        var util = layui.util;
        util.fixbar({
            bar1: '&#xe68e;'
            , bgcolor: '#FF5252'
            , click: function (type) {
                console.log(type);
                if (type === 'bar1') {
                    location.href = './';
                }
            }
        });
    });
</script>
</body>
</html>
